The genus of cartesian products of graphs