Free energy of quantum spin systems: Functional integral representation