Popoviciu's inequality for functions of several variables