Jack Nicholson, Warren Beatty