I like Humblebee's answer - God may "hide" to test us, to see if we miss Him and to see how hard we'll try to seek Him.
I do believe He sometimes does this, but also that our feelings can be wrong too.
We might feel distant from God even when he does not intend these things.
I also like the quote about God inhabiting the praises of His people. I usually find that when I'm feeling desolate, praising God with other people helps, even if only temporarily. Don't wait to feel like doing it - praise Him anyway.
As for the Holy Spirit withdrawing due to our offending Him - He may somewhat withdraw His power, but that is not the same as leaving completely.
He will never leave you.
How can He, the seal of your salvation, who comes alongside and lives within you, who gives you cleansing and salvation, who intercedes foryou with groans that words cannot express, how could He bring Himself to abandon the one He loves?
Don't think that He would leave you, not for a minute - He has promised "I will never leave you nor forsake you."
My advice would be:
A/
get some fellowship - someone to pray sympathetically for you, someone to gently urge you on, someone to praise with and to pore over the Bible with.
B/ as soon as you possibly can, ask God to find somone who needs you, maybe just in some small way, and there, in serving Him, is where you will find the Lord.
God bless, Susana