MOSFET switch using an optocoupler
There is nothing logically wrong with your schematic, but there are a couple of points you need to think about. 

Your biggest potential problem is that the opto-coupler acts like a constant current source. As you turn it on it will always be current limited by the gate capacitance charging. In addition the Opto has to provide current through the 10k resistor, which to hold your device on (VGS > 2.5 V @10 A) requires 0.25 mA. To get your Gate to somewhere near 10 volts this load current increases to around 1 mA. 

You have approximately 6 mA through the LED on your PC817, therefore likely 3 mA current limit on the output (worst case). The IRL540N will have approximately 2000 pF of input capacitance. This will result in a slow turn on/off of the FET (I'd expect worst case in the range of 1 - 5 uS).
You will also have very large turn off delays ( >15 uS) if the Gate voltage does get up to 10 V or above. The turn off time is soft too since it's defined by the 10 k * 2000 pF discharge rate.
Neither the turn on/off or delay times may be a problem at your envisaged output current levels, you just need to be aware of the issues particularly if you are ever intending to use PWM control (eg PCA9685).