The UK Ministry of Defence has officially awarded a £30m contract to produce a prototype laser weapon.