A long plateau phase and an amazing level of brightness have been observed in the X-ray afterglow of GRB 060729. This peculiar light curve is likely due to long-term energy injection in external shock. Here, we present a detailed numerical study of the energy injection process of magnetic dipole radiation from a strongly magnetized millisecond pulsar and model the multi-band afterglow observations. It is found that this model can successfully explain the long plateaus in the observed X-ray and optical afterglow light curves. The sharp break following the plateaus could be due to the rapid decline of the emission power of the central pulsar. At an even later time (similar to 5 x 10(6) s), an obvious jet break appears, which implies a relatively large half opening angle of theta similar to 0.3 for the GRB ejecta. Due to the energy injection, the Lorentz factor of the outflow is still larger than two even at 10(7) s after the GRB trigger, making the X-ray afterglow of this burst detectable by Chandra even 642 d after the burst.