The contacts opening cause a change in the current in the transformer. Capacitors on either the input side or the output side reduce the rate of current change, and thus reduce the voltage.