Production of Z0 bosons in elastic and quasi-elastic ep collisions at HERA