The orbital period variations of two W UMa-type contact binaries, UY UMa and EF Boo, are analyzed by using all available times of light minimum. It is detected that the general trends of their (O - C) curves show an upward parabolic variation, which reveals their continuous period increases at the rates of dP / dt = 2.545 ×10-7 days yr-1 and dP / dt = 2.623 ×10-7 days yr-1 , respectively. Meanwhile, UY UMa also shows a cyclic period variation with a small amplitude of A = 0.0026 days superposed on the long-term increase. Due to their contact configurations, the secular period increases are interpreted as a result of mass transfer from the less massive component to the more massive one. The cyclic period variation of UY UMa may be interpreted in terms of either the magnetic activity or the light time effect.