Study of the structure of molecular complexes. III. Energy surface of a water molecule in the field of a fluorine or chlorine anion