The Power of Contrast for Feature Learning: A Theoretical Analysis