Emergent Cities: A Microeconomic Explanation for Zipf's Law