On a class of elliptic problems with indefinite nonlinearities