Production of Z(0) bosons in elastic and quasi-elastic ep collisions at HERA