i see on the circuit you posted, you have connected the pressure switch to the counter input mean time its giving a path to relay too, try to make an auxiliary contact using a 24V relay so that the input of the counter is isolated from 24V supply terminal.(see the attached) i doubt the noise is from this way of connecting it.
Also about the capacitor, its not to the power supply, you have to connect it across the counter inputs(NO) as a filter, and with a parallel resistor.