Two Spain-based food companies have signed an agreement to merge operations which will see the emergence of a new multinational group.