The prime minister says Labour needs to "all pull together and fight", after a revolt against his leadership.