Nonparametric Penalized Inference of Potential Function in Markov Random Field Models