Optimizing information flow in small genetic networks