Britain's prime minister has condemned a stabbing attack in a Jewish neighbourhood after two people were injured and a man was arrested.