Critical exponent for global existence of solutions to the Schrödinger equation with a nonlinear boundary condition