The word contagiaban is the imperfect form of contagiar in the third person plural.
See the full contagiar conjugation

contagiar

De hecho, muchas personas bromeaban de que el ajo solo lo hacia oler tan mal que las personas no se acercaban a usted y de esta manera no se contagiaban con su resfriado.
In fact, many people joked that garlic merely makes you smell so bad people stay away from you, and so you do not catch their cold. However, there is now some evidence that garlic may really work.
Era una niña tan alegre. Cuando ella reía, los demás niños se contagiaban siempre de su risa.
She was such a cheerful little girl. When she laughed, the other children were always infected by her laughter.
Una vez allí, se dio cuenta rápidamente de que más pacientes morían más por infecciones que se contagiaban allí, en las salas sucias, fétidas, que por las heridas de guerra.
Once there, she swiftly realized that more patients were dying of infections that they caught there, in the filthy, fetid wards, than they were of battle wounds.
Cuando la viruela asolaba Europa, reunieron a muchos científicos, El comienzo de la cura para la enfermedad vino de la fuente menos probable: un productor de leche que se percató de que las lecheras no se contagiaban de viruela.
When it was ravaging Europe, they brought together all these scientists, And the beginnings of the cure to the disease came from the most unlikely source, a dairy farmer who noticed that the milkmaids were not getting smallpox.
Want to Learn Spanish?
Spanish learning for everyone. For free.
SpanishDict Premium
Have you tried it yet? Here's what's included:
Cheat sheets
No ads
Learn offline on iOS
Fun phrasebooks
Learn Spanish faster
Support SpanishDict