I develop an equilibrium matching model in which workers have preferences over consumption and hours of work and are able to self-insure against unemployment risks by accumulating precautionary wealth. Wages and working hours are the outcomes of Nash bargaining between workers and firms. I focus on an unemployment insurance (UI) system with constant benefits of indefinite duration financed through a constant labor income tax. Low-wealth individuals work unusually long hours to quickly accumulate precautionary wealth. The Frisch elasticity of labor supply governs a worker’s utility cost of supplying labor and hence the cost of accumulating precautionary wealth. A lower elasticity implies a higher utility cost of adjusting hours. I take Frisch elasticities from recent research using household data and find that the optimal level of UI benefits is between 34 and 40 percent of average compensation. The potential welfare gains from moving from current 34 percent to the optimal policy are as large as 0.13 percent of lifetime consumption. The optimal replacement rate is decreasing in the Frisch elasticity of labor supply