David Lucas has retired from first-class cricket after a mutual decision not to renew his Worcestershire contract.