You can do it like this:
The +5 Vref directly affects the output voltage- a 1mV change in the reference
represents a 2.5mV change in the output voltage. You can use a series reference chip or a shunt reference and resistors.
Rail-to-rail i/o is unnecessary. You only need an input common mode range that extends to +4.5V with whatever supply you are using, single supply or rail-to-rail output, and an output range that goes to +10 with the supply you are using. Relaxing that constraint allows you to use cheaper and/or more robust op-amps.
Note that the output has to sink 2.5V/R1 with 2.5V in. Regardless of op-amp type, it won't get all the way down to 0V without a negative supply, but it may get close enough for your purposes.
simulate this circuit – Schematic created using CircuitLab
If you want to use a different reference voltage or change other parameters, just scratch down the equations and solve them. With the case of a 5V reference, we can simply write down by inspection:
R3 = R1||R2 (zero balance with 2.5V in)
R1 = 4*(R3||R2) (gain of +5)
The remaining degree of freedom is scaling so we pick something reasonable.