The zCOSMOS survey. The dependence of clustering on luminosity and stellar mass at $z=0.2$–1