Tunisia said it would deploy the army to major cities and arrested nine people on Thursday after 20 foreign tourists were shot dead in an attack on a museum which Islamic State militants called “the first drop of the rain”.