Iterate through array and add contacts to hash