If it happened what you've described, it means that iP5 and iP6 have the same Apple ID (and that's not good for you nor for your granddaughter).
Read what you had to do before giving away your iP5 (after making a full backup of that device):
What to do before you sell or give away your iPhone, iPad, or iPod touch - Apple Support
As far as Contacts are concerned, it looks like you had your contacts synced with iCloud.
But if you deleted them.... check if they are still on iCloud (via computer open. www.icloud.com the see if contacts are still there (I'm afraid they are gone).
Pls let me know also if you still have a full backup of your iP5.
Regards
Giulio