Magnetic response of a two-dimensional degenerate electron gas in nanostructures with cylindrical symmetry