assuming 12Vin and R4 is really 10K: (12-5)/10K = 0.7mA

No problem when only the PIC run... but when the LED is attach to.. the voltage will really reduce ... 'till the PIC reset.

your problem is there, you don't provide enough current, Zener would need at least few mA just for her +Led+Pic... Repace R4 to 200Ohm

@12Vin : (12-5)/200=35mA
@9Vin : (9-5)/200 = 20mA

@12 Vin : 35mA*35mA*200Ohm = 1/4 Watt

Or better if you replace it for a voltage regulator like 78L05 or any else