You don't need to protect the opto led! Assume you will use TLP504a it will need a forward current of 16mA, current that can be easily obtained with a resistor of 600 ohms @ 12 V. The device can resist up to 1 A of forward peak current for 100 micro seconds, which means spikes of 600 volts.

Cheers

Al.