Preparation of carbon–TiO2 nanocomposites by a hydrothermal method and their enhanced photocatalytic activity