Community detection is one of the fundamental problems in the study of network data. Most existing community detection approaches only consider edge information as inputs, and the output could be suboptimal when covariates are available. In such cases, it is desirable to leverage covariates information for the improvement of community detection accuracy. Towards this goal, we propose flexible network models incorporating covariates, and develop likelihood-based inference methods. For the proposed methods, we establish favorable asymptotic properties as well as efficient algorithms for computation. Numerical experiments show the effectiveness of our methods in utilizing covariates across a variety of simulated and real network data sets.