Gamma-limit of the cut functional on dense graph sequences