Political will needed to counter terrorism, says top UN official