Hierarchical modeling of haplotype effects based on a phylogeny