Dynamics of microcavity polaritons in the presence of an electron gas