Atmospheric aerosols can promote the heterogeneous nucleation of ice, impacting the radiative properties of clouds and Earth's climate. The experimental investigation of heterogeneous freezing of water droplets by carbonaceous particles reveals widespread ice freezing temperatures. It is not known which structural and chemical characteristics of soot account for the variability in ice nucleation efficiency. Here we use molecular dynamics simulations to investigate the nucleation of ice from liquid water in contact with graphitic surfaces. We find that atomically flat carbon surfaces promote heterogeneous nucleation of ice, while molecularly rough surfaces with the same hydrophobicity do not. Graphitic surfaces and other surfaces that promote ice nucleation induce layering in the interfacial water, suggesting that the order imposed by the surface on liquid water may play an important role in the heterogeneous nucleation mechanism. We investigate a large set of graphitic surfaces of various dimensions and radii of curvature and find that variations in nanostructures alone could account for the spread in the freezing temperatures of ice on soot in experiments. We conclude that a characterization of the nanostructure of soot is needed to predict its ice nucleation efficiency.