Generating functional of correlation functions for the nonlinear Schrödinger equation