Vaccination as a trade-off between risks