Determination of light and strange quark masses from two-flavour dynamical lattice QCD