We have studied experimentally spin-dependent photon echoes from excitons in an InGaAs/GaAs quantum well subject to a transverse magnetic field (Voigt geometry). Larmor precession of the spins of the electron and heavy hole in an exciton leads to a periodic transfer of coherence between bright and dark exciton states. The increase in dephasing time due to the transition to the dark states could be useful for coherent control development. A comprehensive analysis shows a good agreement between a four-wave mixing experiment and the predictions of a theoretical treatment based on a five-level exciton model comprising a ground state and two pairs of bright and dark states. The extracted optical dephasing time of bright and dark excitons is equal to 30 and 130 ps, respectively. Exploiting the photon echo reveals evidence of electron Larmor precession with in-plane $g$ factor $|{g}_{e,\ensuremath{\perp}}|=0.44\ifmmode\pm\else\textpm\fi{}0.05$ and heavy hole precession as well. The precession frequency of the latter depends nonlinearly on the applied magnetic field, and the corresponding $g$ factor reaches a value of $|{g}_{h,\ensuremath{\perp}}|\ensuremath{\approx}0.3$ at $B=6$ T. Estimates for the heavy hole $g$-factor spreading as well as the isotropic exchange interaction constant are provided.