This is a common scenario for me. My contract generally includes the following provision.
"Client shall have a perpetual, irrevocable, nontransferable license to use and copy the materials and deliverables created, discovered, invented, developed or prepared in the course of this agreement (“Deliverables”) and prepare derivative works based on the Deliverables for its internal use. All other rights in the Deliverables remain in and/or are assigned to Consultant."
"Client shall have a perpetual, irrevocable, nontransferable license to use and copy the materials and deliverables created, discovered, invented, developed or prepared in the course of this agreement (“Deliverables”) and prepare derivative works based on the Deliverables for its internal use. All other rights in the Deliverables remain in and/or are assigned to Consultant."