Exclusive electroproduction of $omega$ mesons on unpolarized hydrogen and deuterium targets is studied in the kinematic region of Q$^2$>1.0 GeV$^2$, 3.0 GeV < W < 6.3 GeV, and -t< 0.2 GeV$^2$. Results on the angular distribution of the $omega$ meson, including its decay products, are presented. The data were accumulated with the HERMES forward spectrometer during the 1996-2007 running period using the 27.6 GeV longitudinally polarized electron or positron beam of HERA. The determination of the virtual-photon longitudinal-to-transverse cross-section ratio reveals that a considerable part of the cross section arises from transversely polarized photons. Spin density matrix elements are presented in projections of Q$^2$ or -t. Violation of s-channel helicity conservation is observed for some of these elements. A sizable contribution from unnatural-parity-exchange amplitudes is found and the phase shift between those amplitudes that describe transverse $omega$ production by longitudinal and transverse virtual photons, $gamma^{*}_{L} to omega_{T}$ and $gamma^{*}_{T} to omega_{T}$, is determined for the first time. A hierarchy of helicity amplitudes is established, which mainly means that the unnatural-parity-exchange amplitude describing the $gamma^*_T to omega_T$ transition dominates over the two natural-parity-exchange amplitudes describing the $gamma^*_L to omega_L$ and $gamma^*_T to omega_T$ transitions, with the latter two being of similar magnitude. Good agreement is found between the HERMES proton data and results of a pQCD-inspired phenomenological model that includes pion-pole contributions, which are of unnatural parity.