Self-similar evolution of a body eroding in a fluid flow