Here, "nicely" is serving as an adverb to give an information about the verb of the sentence ("talk"). Even though it comes from the adjective <em>nice</em>, which would modify a noun or a pronoun and not a verb, the addition of the suffix <em>-ly</em> makes it an adverb. That is why it works in this sentence.