Do not use UHT milk. Fresh pasteurised milk is fine.
If the yogurt is not thick enough, it might mean that the milk was too hot when mixed with yogurt or the temperature was too low during the resting time (6-8 hrs). It could also be due to the yogurt starter - try using a different brand that has more live cultures.