We have studied the electron spin relaxation in semiconductor InAs/GaAs quantum dots by time-resolved optical spectroscopy. The average spin polarization of the electrons in an ensemble of p-doped quantum dots decays down to 1/3 of its initial value with a characteristic time T(Delta) approximately 500 ps, which is attributed to the hyperfine interaction with randomly oriented nuclear spins. We show that this efficient electron spin relaxation mechanism can be suppressed by an external magnetic field as small as 100 mT.