The "best" solution would be a native AC input for the PLC.
You could use a 24 V dc power supply. Connect the mains in parallel to the pump'p power, connect the 24 V output to the PLC. A bit of overkill, but quick and not too expensive.
Or you could use a relay with a 230 V AC (!) coil, connect the coil in parallel to the pump, then connect one contact side to the input of the PLC, the other to a 24 V supply.