A variational approach for nonlocal problems with variable exponent and nonhomogeneous Neumann conditions