Labor market outcomes demonstrate considerable variation between and within skill groups. We construct a general equilibrium model with incomplete markets and exogenous differences that matches these facts. We study the role of exogenous heterogeneity in choosing the optimal replacement rate and the maximum benefit for an unemployment insurance (UI) system. The optimal average replacement rate is 27%, compared to 0% in a model without exogenous heterogeneity. The relatively generous choice is due to the redistributive role of UI, which is a manifestation of two elements. First, workers who are unemployed more often receive positive net transfers from the UI system because they draw resources more frequently. Second, the existence of a cap on benefits makes UI progressive. Our main result holds in the presence of a generous progressive taxation system.