First-principles calculations on LixNiO2: phase stability and monoclinic distortion