The spin dynamics of positively (X + ) and negatively (X − ) charged excitons in InP/In0.48Ga0.52P quantum dots subject to a magnetic field is studied. We find that a characteristic feature of the system under study is the presence of nuclear quadrupole interaction, which leads to stabilization of the nuclear and electron spins in a quantum dot in zero external magnetic field. In detail, the nuclear quadrupole interaction leads to pinning of the Overhauser field along the quadrupole axis, which is close to the growth axis of the heterostructure. The nuclear effects are observed only when resident electrons are confined in the quantum dots, i.e. for X − trion photoexcitation. The presence of X − and X + trion contributions to the photoluminescence together with the quadrupole interaction significantly affects the dynamics of optical orientation in Voigt magnetic field. In absence of dynamic nuclear spin polarization the time evolution of the photoluminescence polarization was fitted by a form which describes the electron spin relaxation in "frozen" nuclear field fluctuations. In relatively large external magnetic fields exceeding 60 mT good agreement between theory and experiment is achieved.