This paper investigates GRB 050802, one of the best examples of a it Swift gamma-ray burst afterglow that shows a break in the X-ray lightcurve, while the optical counterpart decays as a single power-law. This burst has an optically bright afterglow of 16.5 magnitude, detected throughout the 170-650nm spectral range of the UVOT on-board Swift. Observations began with the XRT and UVOT telescopes 286s after the initial trigger and continued for 1.2 x 10^6s. The X-ray lightcurve consists of three power-law segments: a rise until 420s, followed by a slow decay with alpha_2 = 0.63 +/- 0.03 until 5000s, after which, the lightcurve decays faster with a slope of alpha_3 = 1.59 +/- 0.03. The optical lightcurve decays as a single power-law with alpha_O = 0.82 +/- 0.03 throughout the observation. The X-ray data on their own are consistent with the break at 5000s being due to the end of energy injection. Modelling the optical to X-ray spectral energy distribution, we find that the optical afterglow can not be produced by the same component as the X-ray emission at late times, ruling out a single component afterglow. We therefore considered two-component jet models and find that the X-ray and optical emission is best reproduced by a model in which both components are energy injected for the duration of the observed afterglow and the X-ray break at 5000s is due to a jet break in the narrow component. This bright, well-observed burst is likely a guide for interpreting the surprising finding of Swift that bursts seldom display achromatic jet breaks.