We examine spontaneous emission in organic electroluminescent devices and investigate the influence of the local photonic mode density on the emissive properties of molecular emitters. Spontaneous emission in organic electroluminescent devices is modeled by means of an approximate closed-form solution for the exciton rate equation, which yields the efficiency of conversion of electrical charges into molecular excited states. The exciton decay rate and the efficiency of conversion of molecular excitation into far-field radiated photons are described using a state-of-the-art classical electromagnetic formalism suitable to model multilayered organic light-emitting diodes (OLEDs). We present an in-depth analysis of the influence of optical microcavities and the corresponding resonant modes on the luminescent properties of organic molecules. Near-field coupling and coupling to metallic reflectors are demonstrated as the main effects responsible for environment-induced modifications of the rate and efficiency of spontaneous emission. The extent to which the excitonic decay rate is modified by the optical microcavity (Purcell effect) is shown to be strictly dependent on the intrinsic luminescence quantum yield of the molecular emitter. The modeling formalism is successfully validated against experimental results obtained on three series of small-molecule $p$-$i$-$n$ OLED samples, featuring phosphorescent or fluorescent molecular emitters, with a widely varying thickness of the optical microcavity. We demonstrate that, within its limits of validity, the theoretical treatment in this work provides a rigorous quantitative description of spontaneous emission in organic luminescent devices and allows for the identification of the factors determining the OLED internal and external quantum efficiencies.