But so much the more went there a fame abroad of him: and great multitudes came together to hear, and to be healed by him of their infirmities. And he withdrew himself into the wilderness, and prayed.Here we have Jesus busily curing people of diseases. I would imagine there were a lot of them based on other stories, and who wouldn't go visit Him as he could heal their wounds. That is a very important task. I might think it was more important than prayer because it is actually doing something, and all those people are more likely to believe in Him. But I'm not Jesus. Jesus, who already knows God because He is God, stops what he is doing to go pray. The commentaries note that the original language indicates he did this frequently, leaving His mission of healing to go and converse with the Father.
Every Christian needs a half-hour of prayer each day, except when he is busy, then he needs an hour.
~ St Francis de Sales