Thousands of people have attended the funeral of a Taliban government minister killed in an Islamic State suicide bombing.