Harmonization with four voices is a musical problem which is subject to hard constraints, which absolutely need to be fulfilled, as well as to soft constraints, which preferably hold, but are not mandatory. In this paper, we model this problem as a valued constraint satisfaction problem (VCSP): costs are assigned to possible solutions based on the constraints they violate. We design an algorithm that finds a minimal-cost solution, thus solving the harmonization problem, and we present initial results obtained by this algorithm. Keywords-- functional harmony, valued constraint satisfaction problems, soft constraints