A quantum theory of quantum well polaritons in semiconductor microcavities is developed. The model takes into account the coupling between the exciton level and the structured continuum of electromagnetic modes relative to the particular geometry of the microcavity. A general equation for the polariton dispersion is obtained as a function of the cavity and exciton parameters. The equation is valid in both weak and strong coupling regimes and reproduces the existing measurements of microcavity polariton dispersion. A model for the polariton luminescence is then derived from the theory. It is possible to define a polariton decay rate only when the resonances in the polariton density of states can be considered as quasimodes. The two limiting cases of very weak and very strong coupling regimes are consequently identified. In these cases the polariton radiative probabilities are derived for light emitted on the left and right sides of the microcavity separately. The influence of the microcavity structure on the polariton dispersion and radiative rates is discussed and in particular the role of the microcavity leaky modes is described in detail. A discussion of the luminescence mechanism in the intermediate coupling case is also presented.