Effective pair potentials and the structure of ices VIII and IX