Voltage divider on optocoupler emitter output
IMO you should be using a linear voltage regulator, not a Zener and especially not a resistor divider. Both those options waste power, which you said you didn't want to do. The resistor divider won't be stable and that 5 V will change depending on how many loads are switched on/off.
A 5 V regulator can be had for pennies. You need make sure:

It can handle the power i.e. 2 mA * 19 V * 5 = less than 1/4 W (verify this, your numbers are a bit confusing to me) Not sure what you have connected to the 5 V line. If it's just those 10K pull-ups, then the power required goes to &quot;almost nothing&quot;. If you need the CPU powered (25 mA?), you'll need a little beefier regulator as the power goes to about 3/4 W.
It can handle the 24 V input voltage.

Digikey has hundreds of regulators in stock that meet these criteria, such as these.
The best thing is actually a buck regulator, as it'd be most efficient, but it's usually a bit more complex thing to deal with. Linear regulators are easy. I'd start with the linear, and consider a buck if you find you can't tolerate the power loss.