Is R2 needed on this circuit?
Your beta is actually closer to 100 for this use case (Ic = 100mA) The optocouplers CE junction voltage drop should be small, but lets say it drops 0.2V,

So 5V - 0.2V - 0.7V (transistor base) = 4.1V

79.3mA / Beta of 100 = 0.793mA

4.1V / 0.793mA  = 1265 Ohm

So R2 should be about 1.2K

You do want to include R2, otherwise the transistor base looks like a diode to the 5V rail, and may damage both the transistor, the optocoupler and possibly your power supply by drawing too much current.