Casimir–Polder interaction between an atom and a cylinder with application to nanosystems