The 48.7 kJ is the amount of energy required to maintain a constant temperature in the system. The electrolysis of water is an endothermic reaction that would otherwise decrease the system's temperature.
In other words, less electrical energy is needed because the environment, which remains at 298K, acts as a heat bath to keep the system at 298K too.
There's another way of looking at things: Hydrogen and oxygen, as gases, have a much larger specific entropy than water. The Second Law favors entropy creation, and this benefit is quantified by the term [itex]T\Delta S[/itex]. As a result, less electrical energy is required from us. (At high enough temperatures, many reactions will therefore run on their own; melting and boiling are two common examples.)
In more technical terms, we could write the system potential [itex]Z[/itex], where
[tex]Z=E+PV-TS-\phi Q[/tex]
[tex]\Delta Z=\Delta E+P\Delta V-T\Delta S-\phi \Delta Q[/tex]
and [itex]\phi[/itex] and [itex]Q[/itex] are voltage and charge, respectively. The electrolysis reaction will be spontaneous if the change in [itex]Z[/itex] is zero*; that is, the energy [itex]E[/itex] needed to drive the reaction that turns H2O into H2 and O2, plus the energy needed to do work on the environment because H2 and O2 take up more space, minus the energy from the environment to keep everything at 298K (this is the 48.7 kJ), minus the electrical work we do transferring charge at a certain voltage, must be zero. This is the schematic drawn in the link you gave. Does this make sense?
*Any process is spontaneous if the change in appropriate potential is zero. The potential is constructed by starting with [itex]E[/itex] and removing the energy terms associated with constant variables. (This is called a Legendre transform.) [itex]PV[/itex] is a special case that is added, not subtracted, because an increase in volume corresponds to negative work done on a system.