Wa maa ja'alna ashaba an-nar illa mala'ikatan wa maa ja'alna iddatahum illa fitnatan li alladhina kafaru li yastayqina alladhina utu al-kitaba wa yazdada alladhina amanu imanan wa laa yartaba alladhina utu al-kitaba wa al-mu'minuna wa li yaqula alladhina fi qulubihim maradan wa al-kafirina maadha arada Allah bi hadha mathalan ka dhalika yudillu Allahu man yasha'a wa yahdi man yasha'a wa maa ya'lam junuda rabbika illa huwa wa maa hiya illa dhikra li al-bashar
And We have set none but angels as guardians of the Fire. And We have fixed their number only as a trial for the rejectors, in order that the People of the Scripture may arrive at a certainty and that the believers may increase in faith, and that no doubt may be left for the People of the Scripture and the faithful, and that those in whose hearts is a disease and the rejectors may say: What does Allah intend by this example. Thus Allah leads astray whom He wills and guides whom He wills. And none can know the hosts of your Lord but He. And this is nothing but a reminder to mankind
The following is an excerpt of commentary on this ayah, from Tafsir Ibn Kathir:
Guardian angels, stern and severe [are guardians over hell]. [They are] extremely strong in their creation. They cannot be stood against nor defeated. Allah has only mentioned their number as being nineteen as a test from Him for mankind, and so that the People of the Scripture may know that this Messenger is true. For he speaks according to the same thing that they have with them of heavenly revealed Scriptures that came to the Prophets before him. This is due to what they witness from the truthfulness of the information of their Prophet, Muhammad... By way of examples like this, faith becomes firm in the hearts of some people and it is shaken with others. This has a profound wisdom and it is an irrefutable proof. None knows the Soldiers of Allah except Him. None knows their number and their count except Allah. This is so that one does not make the mistake of thinking that they are only nineteen in all