Magnetostatic fields in tubular nanostructures