This paper studies the design of Ramsey optimal monetary policy in a Health New Keynesian (HeNK) model with Susceptible, Infected and Recovered (SIR) agents. The nonlinear model is estimated with maximum likelihood techniques on Euro Area data. Our objective is to deconstruct the mechanism by which contagion risk affects the conduct of monetary policy. If monetary policy is the only game in town, we find that the optimal policy features significant deviations from price stability to mitigate the effect of the pandemic. The best outcome is obtained when the optimal Ramsey policy is combined with a lockdown strategy of medium intensity. In this case, monetary policy can concentrate on its price stabilization objective.