The first sentence needs the accent because "qué" is working as some sort of pronoun. That's its role in exclamations and questions as well.
In the second sentence it doesn't need it, because the pronoun is already there with "lo".
Both sentences mean the same.