얘기하다 is shortened from 이야기하다. And 이야기 as a noun originally means a story. So 이야기+하다 means to say a story. The meaning of 이야기하다 is depending on the preposition you use with. If you use ~~와 or 랑 이야기하다, it means to have a conversation because 와/랑 means "with" so it's both ways. Give and take, back and forth. But if you use ~~에게 or 한테 이야기하다, it's just one direction because 에게/한테 means "to". So saying your story to someone just one direction is different from speaking "with" someone. So 한테 이야기하다 as in your example can be just whatever you say, like a story, order, instruction, etc. We don't know what you say. We just know the action you do, to say something.
말 means, as noun, a word or words. So 말 +하다 means say a word or say words. So it simply means to say something. And this is not normally used with 와/랑. This is normally used for saying something on one direction.
So, 한테 말하다 and 한테 얘기하다, both are using "to" so they are just similar in this case. Both means to say something. The only difference I feel is that 말했어요 is for saying something shorter and more simple because 말 means words, and 얘기했어요 is for saying something longer, more than just a few words or sentences. More than that.
But if the preposition changes into 와/랑, 얘기하다 can mean to speak with or to have a conversation with, on both ways, but 와/랑 말하다 is technically, I mean in grammar, it's not wrong but people don't use it that much because 말하다 normally used for one direction saying.
Hope it helps you better!