Nuclear energy density functional from chiral two-nucleon aaand three-nucleon interactions