Plateaus are common in X-ray afterglows of gamma-ray bursts. Among a few scenarios for the origin of them, the leading one is that there exists a magnetar inside and persistently injects its spin-down energy into an afterglow. In previous studies, the radiation efficiency of this process is assumed to be a constant $gtrsim0.1$, which is quite simple and strong. In this work we obtain the efficiency from a physical point of view and find that this efficiency strongly depends on the injected luminosity. One implication of this result is that those X-ray afterglow light curves which show steeper temporal decay than $t^{-2}$ after the plateau phase can be naturally understood now. Also, the braking indexes deduced from afterglow fitting are found to be larger than those in previous studies, which are more reasonable for newborn magnetars.