Optimal location of economic activity and population density: The role of the social welfare function