This simple circuit, which requires a low current (50mA) relay for 5 to 12V power supplies, was found in documentation from the 1980s. The transistor could be the BC548 and for the phototransistor any sensitive type serves. A potentiometer of 10 k between the base and ground of the circuit can be added to serve as a sensitivity control.