Jon,
Their position varied, but generally they were on the side shrouds, high enough up to be above the waves and be seen from a distance but low enough to be lit from deck as Ned says! Click on this photo of "Jolie Brise" and you can see it between the two side shrouds about six feet above the deck with the boat name on it.
They would have had an oil lamp set at the back edge of a wooden screen board to show a light forward and to the side. The size of this "screen board" depended on the rigging to which it was attached, so you could have short or long ones. These side screens were three sided, bottom back and inner, sometimes square edge and functional, sometimes elegantly carved.
The rules have, for many years, been that the inside of the screen boards should be matt black to avoid light being scattered outside their "sector". Admittedly not all owners knew this and you did see white or even green and red like this one above!
The wires to the tea lights could conveniently be run up the rearmost of the two shrouds to which you fix the lights.
Chris