A Convex Framework for Epidemic Control in Networks