We have investigated the electrical Hanle effect with magnetic fields applied at an oblique angle (theta) to the spin direction [the oblique Hanle effect (OHE)] in CoFe/MgO/semiconductor (SC) contacts by employing a three-terminal measurement scheme. The electrical oblique Hanle signals obtained in CoFe/MgO/Si and CoFe/MgO/Ge contacts show clearly different line shapes depending on the spin lifetime of the host SC. Notably, at moderate magnetic fields, the asymptotic values of the oblique Hanle signals (in both contacts) are consistently reduced by a factor of cos(2)(theta) irrespective of the bias current and temperature. These results are in good agreement with predictions of the spin precession and relaxation model for the electrical OHE. At high magnetic fields where the magnetization of CoFe is significantly tilted from the film plane to the magnetic-field direction, we find that the observed angular dependence of voltage signals in the CoFe/MgO/Si and CoFe/MgO/Ge contacts is well explained by the OHE, considering the misalignment angle between the external magnetic field and the magnetization of CoFe.