A critical point theorem and existence results for a nonlinear boundary value problem