Cosmological evolution of homogeneous universal extra dimensions