This will do the trick (I verified this in a controller, but it can run in a filter as well).
** Note this works for the default view engine/default view page and might need tweaking otherwise, it's not hardened by any means, it's just to show the pattern
Type modelType = null;
var view = ViewEngines.Engines.FindView(this.ControllerContext, "Index", string.Empty);
var bmView = (BuildManagerCompiledView)view.View;
// this need caching, no reason to call build manager again and again.
var razorView = BuildManager.GetCompiledType(bmView.ViewPath);
// this doesn't allow for customizing the page type (but not a common scenario)
if (typeof(WebViewPage).IsAssignableFrom(razorView) && razorView.BaseType.IsGenericType)
{
modelType = razorView.BaseType.GetGenericArguments()[0];
}