UK stocks end higher; Pets at Home tops midcaps