Environmental Externalities and the Optimal Level of Market Power