Relay optocoupler driver
According to the datasheet PCF817 forward voltage 1.2V and forward
  current 20mA


As you can see in the graph below the PC817 has typically a current transfer ratio of round about 500% from forward currents as low as 1 mA.



If you put 1mA into it you can reasonably expect to get significantly more than 1 mA out of it and into the BJT's base that operates the relay. This is more than enough current to drive the transistor and switch the relay on.

Regards the LEDs in series with the opto-coupler input circuit, most LEDs can easily been visible when operated at currents as low as 1 mA.