A Newton method for three-dimensional fretting problems