Collective properties of excitons in the presence of a two-dimensional electron gas