Effect of exciton dephasing in a semiconductor microcavity