We study the macroeconomic effects of the COVID-19 epidemic in a quantitative dynamic general equilibrium setup with nominal rigidities. We evaluate various containment policies and show that they allow to dramatically reduce the welfare cost of the disease. Then we investigate the role that monetary policy, in its capacity to manage aggregate demand, should play during the epidemic. According to our results, treating the observed output contraction as a standard recession leads to overly expansionary policy. Finally, we check how central banks should resolve the trade-off between stabilizing the economy and containing the epidemic. If no administrative restrictions are in place, the second motive prevails and, despite the deep recession, optimal monetary policy is in fact contractionary. Conversely, if sufficient containment measures are introduced, central bank interventions should be expansionary and help stabilize economic activity.