Opto-isolator to directly drive load
Maybe you have a special reason for using opto-isolators but assuming that the 12V supply to the relay coils can have a common 0V or ground with the Arduino's 0V then using regular BJTs would seem more sensibile and of course will be more efficient. Below is not the exact circuit because it shows a motor but substitute the motor with the relay coil and this works: -



The supply shown (5V) can reasonably be anything such as 24V (if you had 24V relays). 12V is no problem of course. The transistor is an NPN and something like a BC547 is ideal. The base current should be designed to be about 5mA for decent saturation of the transistor.

If your MCU runs from 3V3 then approximately 2.7V will drop across the resistor at 5mA and this implies a resistance of 540ohms. A 470ohm or 560ohm will be fine.

Note that the diode across the motor/relay is always required to protect against back-emfs when the transistor turns off. For the relay current you have a BAS16 or 1N4148 will be fine.

If you have a reason to use an opto and you are happy with its current transfer ratio and power dissipation then using the opto will work too.