We study the behavior of exciton polaritons in an optical microcavity with an embedded semiconductor quantum well. We use two-component exciton-photon approach formulated in terms of path integral formalism. In order to describe spatial distributions of the exciton and photon condensate densities, the two coupled equations of the Gross-Pitaevskii type are derived. For a homogeneous system, we find the noncondensate photon and exciton spectra, calculate the coefficients of transformation from the exciton-photon basis to the lower-upper polariton basis, and obtain the exciton and photon occupation numbers of the lower and upper polariton branches for nonzero temperatures. For an inhomogeneous system, the set of coupled equations of the Bogoliubov-de-Gennes type is derived. The equations govern the spectra and spatial distributions of noncondensate photons and excitons.