A cruise ship sent a mayday after its engines failed in stormy conditions off the west coast of Norway.