Oracle inequalities for network models and sparse graphon estimation