Regardless of the fact that these verbs are considered irregulars, to choose the correct conjugated form take a look at the pronoun being used.
Since each pronoun as is own dedicated ending (which is why in Spanish you can omit the pronouns in sentences), focus on it to select the proper conjugation.
Habia because Habia means there were. On the other hand we have contaba which men tell, saludaba which mean said hi, and nacia which means born. so your best bet is Habia