A Network-Specific Markov Random Field Approach to Community Detection