Hidden symmetry of four-point correlation functions and amplitudes in N=4 SYM