I develop and calibrate an equilibrium search model with endogenous savings and search intensity. The wage is endogenized using Nash bargaining and the number of vacancies is tied down by a free entry condition. This allows me to conduct a counterfactual analysis of the optimal unemployment insurance (UI) level. The provision of UI is motivated by the worker's inability to perfectly insure against income shocks, but at the same time UI introduces distortions into workers' search intensity decisions and firm vacancy creation. I find that equilibrium effects are important. When the UI level is raised 25%, they constitute around one-third of the increase in total unemployment. However, even with limited savings by workers, optimal UI is close to zero. It is further shown that ignoring the possibility of self-insurance greatly affects the optimal UI level.