Atomistic study of energy and structure of surfaces in NiO