Hurwitz trees and Berkovich curves