Modeling protein cores with Markov random fields