Charge-coupled device photometric observations of the W UMa-type binary star UX Eridani are presented. Comparing the B light curve with that obtained by Binnendijk in 1964-1965, the variation of the light curve around the primary minimum was found. Photometric solutions of Binnendijk's and our light curves were derived by using the new version of the Wilson-Devinney program. Our solutions confirmed that UX Eri is a marginal W-type overcontact binary system with a very low degree of overcontact, f < 15%. The change of the light curve around the primary minimum was explained as the disappearance of a dark spot on the more massive component star. This suggests that UX Eri shows strong magnetic activity, which is in agreement with its having the highest X-ray flux among 57 W UMa-type binary stars studied by Stepien et al. The high level of magnetic activity was interpreted as the result of a shallow common convective envelope. Orbital period changes were analyzed using several newly determined CCD times of light minimum together with others collected from the literature. A cyclic period change (T = 45.3 yr) was found to be superimposed on a long-term increase (dP/dt = +7.7 × 10-8 days yr-1). The period oscillation and the existence of third light both confirm that UX Eri contains a tertiary component. Since no spectroscopic companion was found, it is estimated that the mass of the third body is M3 < 0.56 Modot. The tertiary component star is moving in an eccentric orbit (e' = 0.72) with an orbital inclination of i' > 44.5°. The tertiary component may have played an important role in the formation of the progenitor of UX Eri by transferring angular momentum during the Kozai oscillation. In that way, the detached progenitor could evolve into overcontact configuration via magnetic braking. It was found that the timescale of the period increase is close to the thermal timescale of the less massive component, which suggests that UX Eri is in an evolutionary state of thermally conservative mass transfer from the less massive component to the more massive one.