And the mechanical friction caused by the alternator does not depend on whether electricity is being needed or not.
Correct.
In other words, when energy is not needed it is wasted
Wrong. The electrical energy produced by the alternator is not the result of mechanical friction but of magnetic force on top of the (very small amount of) friction, which the motor has to overcome.
Inside the alternator, wire coils are made to move through magnetic fields. the force they have to overcome is proportional to the current that goes through the wire. If there is no current (i.e. no electrical energy is being used), there is no magnetic force. The higher the current, the more force the motor has to overcome.
As for how much fuel this uses: the California Energy Commission cites a number of studies that claim it's somewhere between 0.5% and 1% - but that seems to to be the increase expected when mandating lights to be on during daytime, which would be on top of existing nighttime use.
The National Highway Traffic Safety Administration (NHTSA) reports that extra
fuel consumed with the use of DRLs is “a fraction of a mile per gallon,” while the
Insurance Institute for Highway Safety cites a range of $3 to more than $40 per
year in extra fuel cost (a consolidation of costs reported by GM and Transport
Canada). The Institute for Road Safety Research of Netherlands (SWOV)
reports 0.9 percent additional fuel use for DRLs based on European programs
that have been in effect for several years. A Swedish study completed in 2002
estimated a fuel economy penalty range of 0.5 to 1.5 percent for various
approaches among member nations of the European Union in implementing DRL
programs. A recent study in Switzerland under “real world” Swiss driving
conditions in European design gasoline passenger cars indicated about 0.8
percent fuel use when adjusting reported results to DRL use conditions.
DRL in the above quote stands for Daytime Running Lamp. There are different types of DREs, with different lighting intensities (and therefore energy use). Assuming that DREs burn with a lower intensity than headlamps (many do), then this sets a lower bound on the cost of running headlights.
NHTSA estimates that only a fraction of a mile per gallon will be lost, depending on the type of system used. General Motors estimates the cost to be about $3 per year for the average driver.
(Talking about the impact of Daytime Running Lights) - a good answer to this question will find the original source, not just every website repeating the claim!