Statistical mechanics of vibration-induced compaction of powders