Magnetic islands and spontaneous generation of zonal flows