Weak-value amplification as an optimal metrological protocol