Pirates hijacked a cargo ship off the coast of Somalia on Monday, a European Union naval task force said.