There were issues with the earth in the dash for the stereo which caused problems with the tail lights. Have you done anything with the stereo? Is it the factory unit? What happens if you temporarily add an earth wire between the stereo chassis and the vehicle chassis?
For all lights at once you'd have to suspect either a fuse, an earth problem or a functional issue. If the front lights are working then I'd assume the ECU is not stuffing things up.
How about testing the connectivity between the battery negative and the tail lights, specifically the negative side?