It depends both on the lights and the dynamo. Incandescent lights used substantial chunks of your pedaling power. LED lights need maybe 5W or so. Hub dynamos are pretty efficient. For an untrained person your average power output is around 100W. That means powering the light would be around 5% of your power if you’re using an efficient hub dynamo. That’s in the ballpark of “bad chain maintenance costs more energy”