Tourists visiting Jamaica's Montego Bay have been urged to stay in their resorts after authorities declared a state of emergency and deployed the military.