A shell-model calculation of the mass 18 nuclei and the effective interaction in the sd-shell